<script>on mouseUpglobal gPartIDif gPartID is not "" thenlock screengo cd id gPartIDunlock screen with iris open fastelseLinkToBackend ifend mouseUp</script>
<script>on mouseUpglobal gCustData,gShipData,gImprintData,gImprintList,gOrderData,gPONumber,gOrderIDs,gImprintLineif gOrderData = "" thenanswer "There is nothing ordered yet."exit mouseupend ifspinCursorlock screenlock messagespush cdsend closeCard to this cdSpinCursor--•• CheckOrderInfoput "Name,CustomerNumber,CompanyName1,Contact1,Address1,City1,State1,Zip1,Country1,"&¬"AppleLink1,Phone1,Fax1,CompanyName2,Contact2,Address2,City2,State2,Zip2,Country2,"&¬"AppleLink2,Phone2,Fax2,EmployeeNum,DivNum,DeptNum" into rawCustOrderput "Carrier1,Account1,Carrier2,Account2,RequiredDate,,,AppleFundAccount" into rawShipOrderput "Ground Carrier,Air Carrier,Rush Order,Fulfill my order when available,"&¬"Cancel my order after 60 days,Cancel my order,Participating AppleFund,"&¬"Non-Participating AppleFund,Apple Internal,Marketing,Education,"¬into rawShipBtnsput gCustData into rawDataput gShipData into rawData2go cd "Shipping"send openCard to this cdrepeat with z = 1 to (number of cd flds)if z mod 4 = 0 then spinCursorget offset("≈",rawData2)put char 1 to it - 1 of rawData2 into dput item z of rawShipOrder into theVarif theVar is not "" then do "put "& quote & d & quote & " into "&theVardelete char 1 to it of rawData2end repeatrepeat with z = 1 to (number of btns)if z mod 4 = 0 then spinCursorget offset("≈",rawData2)put char 1 to it - 1 of rawData2 into dput "b"& z into theVarif theVar is not "" then do "put "& quote & d & quote & " into " &theVardelete char 1 to it of rawData2end repeatif b1 is not false thenif Carrier1 = "" thenShipError "Shipping","Carrier1"else if Account1 = "" thenShipError "Shipping","Account1"end ifelse if b2 is not false thenif Carrier2 = "" thenShipError "Shipping","Carrier2"else if Account2 = "" thenShipError "Shipping","Account2"end ifend ifif b3 is not false thenif RequiredDate = "" thenShipError "Shipping","Required Date"end ifend ifif b7 is not false thenif AppleFundAccount = "" thenShipError "Payment","AppleFund Account"end ifend ifgo cd "Bill To"send openCard to this cdif b9 is true thenput (number of cd flds) into numFldsToVerifyelse put (number of cd flds - 3) into numFldsToVerifyrepeat with z = 1 to numFldsToVerifyif z mod 4 = 0 then spinCursorget offset("≈",rawData)put char 1 to it - 1 of rawData into dput item z of rawCustOrder into theVarif theVar is not "" thenif d = "" thenrepeat until not the lockscreenunlock screen with dissolve very fastend repeatbeepanswer "Please finish filling in your Shipping and Billing Information."select after text of cd fld zexit to HyperCardend ifend ifdelete char 1 to it of rawDataend repeatput imprintedList() into theListrepeat with z = 1 to number of lines of theListspinCursorput line z of theList into theLineput line theLine of gImprintList into theDataif theData = "" thenput line theLine of gOrderIDs into theIDput fld "Title" of cd id theID into titlego cd "Imprinting"send openCard to this cdput "Imprint “"&title&"” with what?" into cd fld "Header"put theLine into gImprintLinerepeat until not the lockscreenunlock screen with dissolve very fastend repeatbeepanswer "Please fill in the imprinting specification for “"&title&"”."select after text of cd fld "imprint"exit to HyperCardend ifend repeatpop cdsend openCard to this cdunlock screengo this cdput gPONumber into tempput gPONumber into cd fld "PO#" of cd "Order Form"repeatask "Please assign a Purchase Order number for this order:" with tempput it into tempif temp = "" then exit mouseupif number of chars in temp > 18 thenanswer "Please limit the Purchase Order number to 18 characters."else exit repeatend repeatgo this cdput temp into gPONumberif gPONumber = "" then exit mouseUpput updatedTotal() into totalAmountif totalAmount > 85 and b9 = true thenanswer "Managers approval is required if the total order (incl. tax & freight) exceeds $100. "&¬"Indicate approval by using manager's address for AppleLink orders." with "Cancel" or "OK"if it = "Cancel" thensend openCard to this cdexit mouseUpend ifend ifgo this cdspinCursorput "APPLEINPRINT" into toWhomput "Apple Literature Order" into subjectAnswer "By sending this link, you have given your electronic signature of approval."& return &¬return & "Go ahead and send order now?" with "Cancel" or "OK"if it = "Cancel" then exit mouseUpput MakeMemo() into memospinCursorSendToAppleLink6 toWhom,"",subject,memoput the result into mSMErrorif mSMError = "" thenput "" into gOrderDataput "" into gOrderIDsput "" into gPONumberput "" into gImprintListput "" into gImprintLinerepeat 4wait 7spinCursorend repeatsend openCard to this cdrepeat until not the lockscreenunlock screen with dissolve very fastend repeatanswer "Your order is in your AppleLink Outbasket."elseanswer "An error occured when sending the message." & return & mSMErrorexit mouseupend ifend mouseUpon ShipError theWord,theFldsend openCard to this cdrepeat until not the lockscreenunlock screen with dissolve very fastend repeatbeepanswer "Please finish filling in the "&theWord&" information."select after text of cd fld theFldexit to HyperCardend shipError</script>
<script>on mouseUpglobal gOrderDataif gOrderData = "" thenanswer "There is nothing ordered yet."exit mouseupend ifspinCursorsend closeCard to this cdset the printTextFont to courierset the printTextSize to 10print MakeMemo()send openCard to this cdend mouseUp</script>
<script>on openbackgroundglobal gShipDataset the usermodify to trueput updatedTotal() into totalAmountif totalAmount > 85 thenspinCursorlock screenlock messagespush cdSpinCursor--•• CheckOrderInfoput "Carrier1,Account1,Carrier2,Account2,RequiredDate,,,AppleFundAccount" into rawShipOrderput "Ground Carrier,Air Carrier,Rush Order,Fulfill my order when available,"&¬"Cancel my order after 60 days,Cancel my order,Participating AppleFund,"&¬"Non-Participating AppleFund,Apple Internal,Marketing,Education,"¬into rawShipBtnsput gShipData into rawData2go cd "Shipping"repeat with z = 1 to (number of cd flds)if z mod 4 = 0 then spinCursorget offset("≈",rawData2)put char 1 to it - 1 of rawData2 into dput item z of rawShipOrder into theVarif theVar is not "" then do "put "& quote & d & quote & " into "&theVardelete char 1 to it of rawData2end repeatrepeat with z = 1 to (number of btns)if z mod 4 = 0 then spinCursorget offset("≈",rawData2)put char 1 to it - 1 of rawData2 into dput "b"& z into theVarif theVar is not "" then do "put "& quote & d & quote & " into " &theVardelete char 1 to it of rawData2end repeatpop cdsend openCard to this cdrepeat until not the lockscreenunlock screen with iris open fastend repeatif b9 = true thenanswer "Managers approval is required if the total order (incl. tax & freight) exceeds $100. "&¬"Indicate approval by using manager's address for AppleLink orders."end ifend ifpass openBackgroundend openBackgroundfunction updatedTotalglobal gOrderDataset the numberFormat to "#.00"put gOrderData into lput 0 into trepeat with z = 1 to number of lines of lput stripspaces(char 73 to 83 of line z of l) into ddelete char 1 of dadd d to tend repeatset the numberFormat to "#"return tend updatedTotalfunction imprintedListglobal gOrderDataput gOrderData into lput "" into theListrepeat with z = 1 to number of lines of lif (char 38 of line z of l) = "Y" then put z & return after theListend repeatreturn theListend imprintedListfunction MakeMemo LinkAdr--•• This function actually pulls all the information together and formats the memo.global gCustData,gShipData,gImprintData,gOrderData,gPONumber,gImprintListspinCursorlock screenlock messagespush cdput "Name,CustomerNumber,CompanyName1,Contact1,Address1,City1,State1,Zip1,Country1,"&¬"AppleLink1,Phone1,Fax1,CompanyName2,Contact2,Address2,City2,State2,Zip2,Country2,"&¬"AppleLink2,Phone2,Fax2,EmployeeNum,DivNum,DeptNum" into rawCustOrderput "Carrier1,Account1,Carrier2,Account2,RequiredDate,,,AppleFundAccount" into rawShipOrderput "Ground Carrier,Air Carrier,Rush Order,Fulfill my order when available,"&¬"Cancel my order after 60 days,Cancel my order,Participating AppleFund,"&¬"Non-Participating AppleFund,Apple Internal,Marketing,Education,"¬into rawShipBtnsput gCustData into rawDataput gShipData into rawData2go cd "Bill To"repeat with z = 1 to (number of cd flds)if z mod 4 = 0 then spinCursorget offset("≈",rawData)put char 1 to it - 1 of rawData into dput item z of rawCustOrder into theVarif theVar is not "" then do "put "& quote & d & quote & " into "&theVardelete char 1 to it of rawDataend repeatgo cd "Shipping"repeat with z = 1 to (number of cd flds)if z mod 4 = 0 then spinCursorget offset("≈",rawData2)put char 1 to it - 1 of rawData2 into dput item z of rawShipOrder into theVarif theVar is not "" then do "put "& quote & d & quote & " into "&theVardelete char 1 to it of rawData2end repeatrepeat with z = 1 to (number of btns)if z mod 4 = 0 then spinCursorget offset("≈",rawData2)put char 1 to it - 1 of rawData2 into dput "b"& z into theVarif theVar is not "" then do "put "& quote & d & quote & " into " &theVardelete char 1 to it of rawData2end repeatspinCursorpop cdput "Ship Via: " into shipInfoif b1 is true thenput item 1 of rawShipBtns &" on "& Carrier1 & ", Account #: "& Account1 & return after shipInfoelse if b2 is true thenput item 2 of rawShipBtns &" on "& Carrier2 & ", Account #: "& Account2 & return after shipInfoend ifif b3 is true then put "RUSH ORDER! " after shipInfoif RequiredDate is not "" thenput "Date Literature is required: "& RequiredDate & return after shipInfoelse put return after shipInfoput "If literature is back ordered, please : " after shipInfoif b4 is true thenput item 4 of rawShipBtns & return after shipInfoelse if b5 is true thenput item 5 of rawShipBtns & return after shipInfoelse if b6 is true thenput item 6 of rawShipBtns & return after shipInfoend ifspinCursorif b7 is true thenput item 7 of rawShipBtns into paymentInfoput return & "AppleFund Account #: "& AppleFundAccount & " " after paymentInfoif b10 is true thenput item 10 of rawShipBtns & return after paymentInfoelse if b11 is true thenput item 11 of rawShipBtns & return after paymentInfoend ifelse if b8 is true thenput item 8 of rawShipBtns into paymentInfoelse if b9 is true thenput item 9 of rawShipBtns into paymentInfoend ifput "Below is an order for Sales literature from Apple In Print. "&¬return & return &"=======================================================================" & return &¬" Official Authorized AppleLink Order Form "& return &¬"=======================================================================" after memoput return & "Date: "& the date & return after memoput return & "--Requestor Information--" & return & return after memoput "Name: "&& name & return after memoput "Customer Number: "&& CustomerNumber & return after memoput "Purchase order number: "&& gPONumber & return & return after memoput "--Ship To Information--" & return after memoput "Company Name: "& CompanyName1 & return after memoput "Contact: "& Contact1 & return after memoput "Street Adr: "& Address1 & return after memoput "City St Zip: "& City1 &" " && State1 & " "&& Zip1 & return after memoput "Country: "& Country1 & " AppleLink #: "& AppleLink1 & return after memoput "Phone: "& Phone1 & " Fax: "& Fax1 & return after memoput return & "--Bill To Information--" & return after memoput "Company Name: "& CompanyName2 & return after memoput "Contact: "& Contact2 & return after memoput "Street Adr: "& Address2 & return after memoput "City St Zip: "& City2 &" " && State2 & " "&& Zip2 & return after memoput "Country: "& Country2 & " AppleLink #: "& AppleLink2 & return after memoput "Phone: "& Phone2 & " Fax: "& Fax2 & return after memoput return & "--Shipping Information--" & return & ShipInfo after memoput return & "--Payment Information--" & return & paymentInfo after memoput return & "--Order Information--" & return after memoput (cd fld "Header" of cd "Order Form") into theHeaderdelete char 32 to 33 of line 1 of theHeaderdelete char 32 to 33 of line 2 of theHeaderput gOrderData into tempOrderDataspinCursorrepeat with z = 1 to number of lines of tempOrderDatadelete char 34 to 36 of line z of tempOrderDataput "…" into char 33 of line z of tempOrderDataend repeatspinCursorput theHeader & return &¬"_______________________________________________________________________________" &return &¬tempOrderData & return after memoput updatedTotal() into tset the numberformat to "#.00"add 0 to tput "$" before tput "Total Price: "& t & return after memoput imprintedList() into imprintListif number of lines of imprintList ≥ 1 thenput return & "--Custom Imprinting Information--" & return & return after memorepeat with z = 1 to number of lines of imprintListspinCursorput line z of imprintList into theLineput line theLine of gImprintList into thisImprintrepeat until "≈" is not in thisImprintput return into char (offset("≈",thisImprint)) of thisImprintend repeatput "• For "& stripSpaces(char 1 to 10 of line theLine of gOrderData) &":" & return &¬thisImprint & return & return after memoend repeatend ifreturn memoend MakeMemo</script>